package psn.kiko.mapper.business.system;

import org.apache.ibatis.annotations.Mapper;
import psn.kiko.annotation.sql.CommonFiledAutoSet;
import psn.kiko.annotation.sql.NeedCommonFiledAutoSet;
import psn.kiko.enumeration.DataBaseOperationType;
import psn.kiko.pojo.dto.FileDTO;
import psn.kiko.pojo.entity.system.FileEntity;
import psn.kiko.pojo.vo.FileVO;

import java.util.ArrayList;
import java.util.List;

/**
 * 文件DAO
 */
@Mapper
public interface FileMapper{
	/**
	 * 批量插入文件信息，通过AOP自动设置上传时间、上传者id、更新时间、更新者id
	 */
	@CommonFiledAutoSet(DataBaseOperationType.INSERT_BATCH)
	void insertList(@NeedCommonFiledAutoSet List<FileEntity> fileEntities);
	
	/**
	 * 获取文件列表
	 */
	List<FileVO> selectList(FileEntity fileEntity);
	
	/**
	 * 根据id批量删除
	 */
	Integer deleteListByIds(List<Long> ids);
	
	List<FileDTO> selectListBySrc(List<String> unUsedImageSrcList);
	
	List<FileDTO> selectListById(ArrayList<Long> ids);
}
